#include "stdio.h"
#include "string.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>



int main() {
   
    printf("%d\n", stdin->_fileno);
    printf("%d\n", stdout->_fileno);
    printf("%d\n", stderr->_fileno);


    //close(1);
    //int fd = open("log.txt", O_WRONLY|O_CREAT, 0644);
    //if (fd < 0) {
    //    perror("open");
    //    return 1;
    //}

    //printf("fd : %d\n", fd);
    //fflush(stdout);
    //close(fd);
    
    
    
    
    
    //int fd1 = open("log.txt1", O_WRONLY|O_CREAT, 0644);
    //int fd2 = open("log.txt2", O_WRONLY|O_CREAT, 0644);
    //int fd3 = open("log.txt3", O_WRONLY|O_CREAT, 0644);
    //int fd4 = open("log.txt4", O_WRONLY|O_CREAT, 0644);

    //printf("fd1 : %d\n", fd1);
    //printf("fd2 : %d\n", fd2);
    //printf("fd3 : %d\n", fd3);
    //printf("fd4 : %d\n", fd4);

    //close(fd1);
    //close(fd2);
    //close(fd3);
    //close(fd4);



   // int fd = open("log.txt", O_RDONLY);
   // if (fd <  0) {
   //     perror("open");
   //     return 1;
   // }

   // char buf[1024] = {0};
   // ssize_t s = read(fd, buf, sizeof(buf)-1);
   // if (s > 0) {
   //     buf[s] = '\0';
   //     printf("%s\n", buf);
   // }
   // close(fd);









    //int fd = open("log.txt", O_WRONLY|O_CREAT, 0644);
    //if (fd < 0) {
    //    perror("open");
    //    return 1;
    //}
    //
    //const char *msg = "hello bit\n";
    //write(fd, msg, strlen(msg));
    //write(fd, msg, strlen(msg));
    //write(fd, msg, strlen(msg));
    //write(fd, msg, strlen(msg));


    //close(fd);


    //char buf[64];
    //fread(buf, 10, 1, stdin);
    //buf[10] = '\0';
    //printf("%s\n", buf);
    
    
    
    //FILE *fp = fopen("./file.txt", "a");
    //if (fp == NULL) {
    //    perror("file open");
    //    return 1;
    //}

    //char buf[] = "wansiying jiayou\n";
    //fwrite(buf, strlen(buf), 1, fp);
    //fclose(fp);
    return 0;
}
